﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FlickrNet;
using Flickr_Reranking_2.Models;
using Model.Classes;

namespace Flickr_Reranking_2.Controllers
{
    public class HomeController : BaseController
    {
        public ActionResult Index()
        {
            return RedirectToAction("Search");
        }

        

        public ActionResult Photo(string id)
        {
            return View(photos.Get(id));
        }


        public ActionResult Search()
        {
            SearchModel model = new SearchModel();
            return View(model);
        }
            

        [HttpPost]
        public ActionResult Search(SearchModel model)
        {
            photos.Search(model);

            return View(model);
            
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }


        //loadne universum fotek do databaze
        public ActionResult Load()
        {
            photos.LoadUniversum();
            return View(null as object);
        }

    }
}
